﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/AdminFunction.Master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="BitPortal.Admin.Comment.Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="TopBarHolder" runat="server">
    <ext:ButtonGroup ID="ButtonGroup1" runat="server" Layout="ToolbarLayout">
        <Items>
            <ext:Button runat="server" ID="btnEdit" Text="Sửa bình luận" Icon="Pencil" Scale="Medium"
                CausesValidation="false">
                <DirectEvents>
                    <Click OnEvent="btnEdit_Click">
                        <EventMask ShowMask="true" Msg="Waiting..." MinDelay="500" />
                    </Click>
                </DirectEvents>
            </ext:Button>
            <ext:ToolbarSeparator />
            <ext:SplitButton runat="server" ID="btnUpdate" Text="Cập nhật" Icon="PageEdit" Scale="Medium">
                <Menu>
                    <ext:Menu ID="Menu1" runat="server">
                        <Items>
                            <ext:MenuItem ID="btnUpdateEnabled" runat="server" Text="Hiển thị" Icon="Eye">
                                <DirectEvents>
                                    <Click OnEvent="btnUpdateEnabled_Click">
                                        <EventMask ShowMask="true" Msg="Waiting..." MinDelay="500" />
                                    </Click>
                                </DirectEvents>
                            </ext:MenuItem>
                            <ext:MenuItem ID="btnUpdateNotEnabled" runat="server" Text="Không hiển thị" Icon="Eye">
                                <DirectEvents>
                                    <Click OnEvent="btnUpdateNotEnabled_Click">
                                        <EventMask ShowMask="true" Msg="Waiting..." MinDelay="500" />
                                    </Click>
                                </DirectEvents>
                            </ext:MenuItem>
                        </Items>
                    </ext:Menu>
                </Menu>
            </ext:SplitButton>
            <ext:ToolbarSeparator />
            <ext:SplitButton runat="server" ID="btnTrash" Text="Xóa bình luận" Icon="Bin" Scale="Medium">
                <Menu>
                    <ext:Menu ID="Menu2" runat="server">
                        <Items>
                            <ext:MenuItem ID="MenuItem8" runat="server" Text="Xóa cùng tất cả trả lời" Icon="Cancel">
                                <DirectEvents>
                                    <Click OnEvent="btnDeleteAll_Click">
                                        <EventMask ShowMask="true" Msg="Waiting..." MinDelay="500" />
                                    </Click>
                                </DirectEvents>
                            </ext:MenuItem>
                            <ext:MenuItem ID="MenuItem9" runat="server" Text="Chỉ xóa những bình luận được chọn"
                                Icon="BinEmpty">
                                <DirectEvents>
                                    <Click OnEvent="btnDelete_Click">
                                        <EventMask ShowMask="true" Msg="Waiting..." MinDelay="500" />
                                    </Click>
                                </DirectEvents>
                            </ext:MenuItem>
                        </Items>
                    </ext:Menu>
                </Menu>
            </ext:SplitButton>
        </Items>
    </ext:ButtonGroup>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <ext:Store ID="Store1" runat="server" OnRefreshData="Store1_RefreshData" RemoteSort="true"
        RemotePaging="true">
        <Proxy>
            <ext:PageProxy />
        </Proxy>
        <Reader>
            <ext:JsonReader IDProperty="DiscussionID">
                <Fields>
                    <ext:RecordField Name="DiscussionID" Type="Auto" />
                    <ext:RecordField Name="DiscussionGroupID" Type="Auto" />
                    <ext:RecordField Name="Name" Type="String" />
                    <ext:RecordField Name="Email" Type="String" />
                    <ext:RecordField Name="Content" Type="String" />
                    <ext:RecordField Name="IsEnabled" Type="Boolean" />
                    <ext:RecordField Name="DatetimeCreated" Type="Date" ServerMapping="Logs.DatetimeCreated" />
                </Fields>
            </ext:JsonReader>
        </Reader>
        <BaseParams>
            <ext:Parameter Name="start" Value="0" Mode="Raw" />
            <ext:Parameter Name="limit" Value="10" Mode="Raw" />
            <ext:Parameter Name="sort" Value="" />
            <ext:Parameter Name="dir" Value="" />
        </BaseParams>
        <SortInfo Field="DiscussionID" Direction="DESC" />
    </ext:Store>
    <ext:GridPanel ID="GridPanel1" runat="server" AutoHeight="true" Title="Danh sách bình luận"
        StoreID="Store1">
        <ColumnModel ID="ColumnModel1" runat="server">
            <Columns>
                <ext:Column Header="Mã" DataIndex="DiscussionID" Groupable="false" />
                <ext:Column Header="Tên người gửi" DataIndex="Name" />
                <ext:Column Header="Email người gửi" DataIndex="Email" />
                <ext:Column Header="Nội dung" DataIndex="Content" Groupable="false" />
                <ext:DateColumn Header="Ngày tạo" DataIndex="DatetimeCreated" Align="Center" Format="dd-MM-yyyy hh:mm:ss"
                    Sortable="false" />
                <ext:Column Header="Hiển thị" DataIndex="IsEnabled" Align="Center">
                    <Renderer Handler="return (value) ? 'Có':'Không';" />
                </ext:Column>
            </Columns>
        </ColumnModel>
        <SelectionModel>
            <ext:CheckboxSelectionModel ID="CheckboxSelectionModel1" runat="server" />
        </SelectionModel>
        <View>
            <ext:GroupingView ID="GroupingView1" runat="server" ForceFit="true" MarkDirty="false"
                ShowGroupName="true" EnableNoGroups="true" HideGroupedColumn="true" ShowGroupsText="Nhóm lại theo cột này" />
        </View>
        <LoadMask ShowMask="true" />
        <Plugins>
            <ext:GridFilters runat="server" ID="GridFilters1">
                <Filters>
                    <ext:NumericFilter DataIndex="DiscussionID" />
                    <ext:StringFilter DataIndex="Name" />
                    <ext:StringFilter DataIndex="Email" />
                    <ext:DateFilter DataIndex="DatetimeCreated">
                        <DatePickerOptions runat="server" TodayText="Now" />
                    </ext:DateFilter>
                    <ext:BooleanFilter DataIndex="IsEnabled" />
                </Filters>
            </ext:GridFilters>
        </Plugins>
        <BottomBar>
            <ext:PagingToolbar ID="PagingToolbar1" runat="server" PageSize="10" />
        </BottomBar>
    </ext:GridPanel>
</asp:Content>
